package com.zyx.lock.controller;

import com.zyx.lock.service.IStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Yaxi.Zhang
 * @since 2022/9/5 09:30
 */
@RestController
public class StockController {

    @Value("${server.port}")
    private Integer serverPort;

    @Autowired
    private IStockService stockService;

    @GetMapping("stock/deduct")
    public String deduct(){
        stockService.deduct();
        return "port " + serverPort + " stock deduct！！";
    }

}
